<%-- 
    Document   : history
    Created on : Apr 22, 2013, 2:38:23 PM
    Author     : clement
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="java.sql.SQLException"%>
<%@page import="java.util.logging.Logger"%>
<%@page import="java.util.logging.Level"%>
<%@page import="java.sql.ResultSet"%>

<%-- 
### Start header template ###
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="header.html" %>
<script type="text/javascript">
    function listHistory() {
        $.ajax({
            type: "GET",
            url: "history/list",
            success: function(msg) {
                $('#list_history').html(msg);
            }
        });
    }

    function getHistory(id) {
        $.ajax({
            type: "GET",
            url: "history/get?view=" + id,
            success: function(msg) {
                $('#get_history').html(msg);
            }
        });
    }

    function dropHistory() {
        $.ajax({
            type: "GET",
            url: "history/drop?delete=1",
            success: function(msg) {
                $('#get_history').html('');
                listHistory();
            }
        });
    }


    listHistory();
</script>
<header class="jumbotron subhead" id="overview">
    <div class="container">
        <h1>History</h1>

        <div id="list_history"></div>

        <br /><br />
        <button class="btn btn-warning" type="button" onclick="javascript:dropHistory();">Clear History</button>


    </div>
</header>
<div class="container monitoring_wrapper">
    <div class="row">
        <div class="span9">

            <%--
### End header template ###
            --%>

            <div id="get_history"></div>

            <%-- 
### Start footer template ###
            --%>    
        </div>
    </div>
</div>
<%@ include file="footer.html" %>
<%-- 
### End footer template ###
--%>    
